package wang.aweb.childcar.model.dao;

import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import wang.aweb.childcar.model.pojo.Member;
import wang.aweb.childcar.model.query.MemberParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository
public interface MemberMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Member record);

    int insertSelective(Member record);

    Member selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Member record);

    int updateByPrimaryKey(Member record);

    List<Member> getList();

    Member selectByOpenId(String openid);

    Member selectByInviteCode(String inviteCode);

    void consum(@Param("id") Integer id, @Param("price") Integer price);

    Member selectByMobile(String mobile);

    List<Member> selectList(@Param("query") MemberParam memberParam);

    Member selectByNickname(String nickname);

    Integer getCount(@Param("query") Map<String, Date> query);

    Integer getAgentUserCount(@Param("agentId") Integer agentId, @Param("starttime") Date starttime, @Param("endtime") Date endtime);

    void chongzhi(@Param("id") Integer memberId, @Param("price") Integer addMoney);
}